<template>
	<view v-show="info">
		<view class="topbak" :style="{ height: sH +10+ 'px' }">

		</view>
		<image src="@/static/r.png" mode="widthFix" style="width: 40rpx;margin-left: 32rpx;" @click="back"></image>
		<view class="bag">
			<view class="mc">
				{{info.rider_status==4?'已完成，继续接单吧':info.rider_status==5?'用户已取消订单':info.rider_status==7?'申诉成功，佣金已发放':'申诉失败'}}
			</view>
			<view class="botinfo">
				<view class="infok" >

					<view class="qu flex items-center">
						<view class="q_o  flex-center">
							{{curNow==2?'取':curNow==3?'锁':curNow==1?'服':'车'}}
						</view>
						<view class="q_w    ">
							{{info.vehicle.trailer_address}}
						</view>
					</view>
					<view class="qu flex items-center">
						<view class="q_o_w flex-center">
							{{curNow==2?'收':'目'}}
						</view>
						<view class="q_w    ">
							{{info.Destination.user_location}}
						</view>
					</view>
					<view class="info flex items-start">
						<view class="o" style="opacity: 0;">
							1.3km
						</view>
						<view class="t">
							{{info.Destination.consignee}}
						</view>
						<view class="h">
							{{info.Destination.mobile}}
						</view>
						<view class="f flex-center" v-show="curNow==2">
							上门安装
						</view>
					</view>

				</view>
				<!-- 照片 -->
				<view class="xcimg2 flex">
					<image :src="info.specifications.image" mode="widthFix" class="zwt"></image>
					<view class="flex-col baginfo justify-around">
						<view class="o text-ellipsis-one">
							{{info.specifications.name}}
						</view>
						<view class="t flex justify-between">
							<view class="">
								{{info.specifications.guige}}
							</view>
							<view class="" style="font-size: 28rpx;color: #00091A;">
								x{{info.specifications.num}}
							</view>
						</view>
						<view class="h">
							￥{{info.specifications.money}}
						</view>
					</view>
				</view>
				<view class="gzinfo">
					<view class="t flex justify-between">
						<view class="gz_o">
							取货单号
						</view>
						<view class="gz_t">
							#{{info.time.pickup_note_number}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							是否上门安装
						</view>
						<view class="gz_t">
							{{info.is_door}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							下单时间
						</view>
						<view class="gz_t">
							{{info.time.createtime}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							接单时间
						</view>
						<view class="gz_t">
							{{info.time.order_acceptance_time}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							取货时间
						</view>
						<view class="gz_t">
							{{info.time.pickup_time}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							送达时间
						</view>
						<view class="gz_t">
							{{info.time.deliveryd_time}}
						</view>
					</view>
					<view class="t flex justify-between" v-show="info.rider_status==5">
						<view class="gz_o">
							服务完成时间
						</view>
						<view class="gz_t">
							{{info.time.service_completion_time}}
						</view>
					</view>
					<view class="t flex justify-between"  v-show="info.rider_status==5">
						<view class="gz_o">
							售后原因
						</view>
						<view class="gz_t">
							{{info.refund.refund_content}}
						</view>
					</view>
					<view class="t flex justify-between"  v-show="info.rider_status==5">
						<view class="gz_o">
							售后类型
						</view>
						<view class="gz_t">
							{{info.refund.after_sales_type}}
						</view>
					</view>
					<view class="t flex justify-between"  v-show="info.rider_status==5">
						<view class="gz_o">
							申请时间
						</view>
						<view class="gz_t">
							{{info.refund.refund_apply_time}}
						</view>
					</view>
				</view>
				<!-- 服务  描述凭证 -->
				<view class="xcimg" v-show="info.rider_status==7||info.rider_status==8">
					<view class="ms" style="font-size: 28rpx;color: #00091A;">
						描述凭证
					</view>
					<view class="" style="font-size: 28rpx;color: #00091A;margin: 24rpx 24rpx 24rpx 0;">
						{{info.appeal.statement_description}}
					</view>
					<view class="imglist flex justify-start flex-wrap">
						<image :src="i" mode="widthFix" class="zwt" v-for="i in info.appeal.picture_of_appeal"></image>
					</view>
				</view>
				<view class="xcimg" v-show="info.rider_status==5">
					<view class="ms" style="font-size: 28rpx;color: #00091A;">
						描述凭证
					</view>
					<view class="" style="font-size: 28rpx;color: #00091A;margin: 24rpx 24rpx 24rpx 0;">
						{{info.refund.describe_credentials}}
					</view>
					<view class="imglist flex justify-start flex-wrap">
						<image :src="i" mode="widthFix" class="zwt" v-for="i in info.refund.refund_image"></image>
					</view>
				</view>
				<view class="gzinfo">
					<view class="t flex justify-between">
						<view class="gz_o">
							配送费
						</view>
						<view class="gz_t">
							￥{{info.time.delivery_fee}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							安装费
						</view>
						<view class="gz_t">
							￥{{info.time.installation_fee}}
						</view>
					</view>
					<view class="t flex justify-between" v-if="info.is_overtime!=0">
						<view class="gz_o">
							超时扣款
						</view>
						<view class="gz_t">
							￥{{info.overtime.deduction}}
						</view>
					</view>
					<view class="t flex justify-between">
						<view class="gz_o">
							合计
						</view>
						<view class="gz_t" style="color: #FF6401;">
							￥{{info.money.order_price}}
						</view>
					</view>
				</view>
			</view>
			<image src="@/static/logo.png" mode="widthFix" class="botbg2">
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curNow: 0,
				active: 0,
				sH: '',
				type: '',
				info: '',
				myla: '',
				mylo: ''
			};
		},
		onLoad(o) {
			this.getWinTop().then(res => {
				this.sH = res.statusBar;
			});
			console.log(o);
			this.curNow = o.curNow
			this.active = o.active
			this.type = o.type
			this.id = o.id
			this.cshLo()
		},
		methods: {
			cshLo() {
				let app = this
				uni.getLocation({
					type: 'wgs84',
					success: function(res) {
						console.log('当前位置的经度：' + res.longitude);
						app.myla = res.latitude
						app.mylo = res.longitude
						console.log('当前位置的纬度：' + res.latitude);
						app.battery_orders()
					},
					fail(err) {
						console.log(err, 'err');
					}
				});
			},
			battery_orders() {
				this.$api.battery_orders({
					order_id: this.id,
					lat: this.myla,
					lng: this.mylo
				}).then(res => {
					this.info = res.data
				})
			},
			back() {
				uni.navigateBack({
					delta: 2
				})
			},

		},

	}
</script>

<style lang="scss">
	::v-deep .amap-logo {
		opacity: 0 !important;
	}

	::v-deep .amap-copyright {
		opacity: 0 !important;
	}

	.botbg2 {
		position: absolute;
		bottom: 30px;
		width: 750rpx;
	}

	.bag {
		position: relative;

		.mc {
			margin: 24rpx 32rpx;
			font-weight: bold;
			font-size: 40rpx;
			color: #00091A;
		}

		.botinfo {
			padding-bottom: 100rpx;

			.infok {
				margin: 0 auto;
				z-index: 1;
				padding: 24rpx;
				width: 686rpx;
				// height: 436rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
				border-radius: 24rpx 24rpx 24rpx 24rpx;

				.title {
					.t_o {
						font-weight: bold;
						font-size: 36rpx;
						color: #FF6401;

						.ji {
							color: #FFFFFF;
							font-size: 24rpx;
							width: 40rpx;
							height: 40rpx;
							background: #FF6401;
							border-radius: 8rpx 8rpx 8rpx 8rpx;
						}
					}

					.t_w {
						font-weight: bold;
						font-size: 28rpx;
						color: #3377FF;
					}
				}

				.qu {
					margin-top: 30rpx;
					padding-left: 10rpx;

					.q_o {
						width: 40rpx;
						height: 40rpx;
						background: #F7FAFF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #3377FF;
					}

					.q_o_o {
						width: 40rpx;
						height: 40rpx;
						background: #3377FF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #FFFFFF;
					}

					.q_o_b {
						width: 40rpx;
						height: 40rpx;
						background: #F7FAFF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #3377FF;
					}

					.q_o_w {
						width: 40rpx;
						height: 40rpx;
						background: #F7FAFF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #3377FF;
					}

					.q_w {
						padding-left: 42rpx;
						font-weight: bold;
						font-size: 32rpx;
						color: #00091A;
						width: 558rpx;
					}

					.q_o_t {
						width: 40rpx;
						height: 40rpx;
						background: #3377FF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #FFFFFF;
					}

					.q_o_d {
						width: 40rpx;
						height: 40rpx;
						background: #F7FAFF;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
						font-size: 20rpx;
						color: #3377FF;
					}
				}

				.info {
					margin-top: 15rpx;

					.o {
						font-size: 20rpx;
						color: #999CA3;
					}

					.t {
						font-weight: bold;
						margin-left: 35rpx;
						font-size: 28rpx;
						color: #333A47;
					}

					.h {
						margin-left: 35rpx;
						font-size: 28rpx;
						color: #999CA3;
					}

					.f {
						margin-left: 24rpx;
						width: 112rpx;
						height: 48rpx;
						background: #3377FF;
						border-radius: 8rpx 8rpx 8rpx 8rpx;
						font-size: 24rpx;
						color: #FFFFFF;
					}
				}

				
			}

			.xcimg {
				margin: 24rpx auto 0 auto;
				width: 686rpx;
				// height: 272rpx;
				padding: 32rpx 24rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
				border-radius: 24rpx 24rpx 24rpx 24rpx;

				.title {
					font-size: 28rpx;
					color: #333A47;
				}

				.imglist {
					.zwt {
						margin-right: 20rpx;
						margin-top: 32rpx;
						width: 140rpx;
						height: 140rpx;
						border-radius: 16rpx 16rpx 16rpx 16rpx;
					}
				}
			}

			.xcimg2 {
				margin: 24rpx auto 0 auto;
				width: 686rpx;
				// height: 272rpx;
				padding: 32rpx 24rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
				border-radius: 24rpx 24rpx 24rpx 24rpx;



				.zwt {
					width: 200rpx;
					height: 200rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
				}

				.baginfo {
					margin-left: 24rpx;
					width: 90%;

					.o {
						font-weight: bold;
						font-size: 32rpx;
						color: #00091A;
					}

					.t {
						font-size: 28rpx;
						color: #999CA3;
					}

					.h {
						font-size: 28rpx;
						color: #00091A;
						text-align: right;
					}
				}
			}

			.gzinfo {
				padding: 5rpx 24rpx 24rpx;
				margin: 24rpx auto 0 auto;
				width: 686rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
				border-radius: 24rpx 24rpx 24rpx 24rpx;

				.t {
					margin-top: 32rpx;
				}

				.gz_o {
					font-size: 28rpx;
					color: #333A47;
				}

				.gz_t {
					font-size: 28rpx;
					color: #00091A;
				}
			}

			.butgp {
				margin: 24rpx auto 0 auto;

				.t_w {
					width: 160rpx;
					height: 68rpx;
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					border: 2rpx solid #CCCED1;
					font-size: 28rpx;
					color: #666B75;
				}

				.t_w_h {
					width: 160rpx;
					height: 68rpx;
					background: #3377FF;
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					color: #ffffff;
					margin-left: 24rpx;
				}

				.o {
					width: 230rpx;
					height: 100rpx;
					background: #F7F7F7;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					font-size: 32rpx;
					color: #333A47;
				}

				.t {
					margin-left: 24rpx;
					width: 384rpx;
					height: 100rpx;
					background: #3377FF;
					box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					font-size: 32rpx;
					color: #FFFFFF;
				}

				.t_jd {
					width: 100%;
					height: 100rpx;
					background: #3377FF;
					box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(51, 119, 255, 0.05);
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					color: #FFFFFF;
					margin: 0 auto;
				}
			}
		}
	}
</style>